// JavaScript Document
var labelHeight = 24;		//label的高度
var minLabelLen = 80;		//label最短的长度
var shadowOffset = 3;
var deriveOffset = 10;//发送或者接收三角形的高
var SYSTEMHEIGHT = 60;
var SYSTEMWIDTH  = 120;
var POINTLENGTH  = 24;
var EXITPOINTW  = 32;
var EXITPOINTH  = 24;

var _completeMsg = "";
var clipboard = [];
var cmdstack = [];
//
var FALSE = 0;
var TRUE  = 1;
//
var YES = "yes";
var NO = "no";
//线的样式
var LINE_STYLE_SOLID = 0;   
var LINE_STYLE_DASH  = 1;
//得到的是完整的还是修改的信息
var SYS_COMPLETE = 'complete';
var SYS_CHANGE   = 'change';
//arraw
var ARRAW_NULL   = 0;
var ARRAW_SINGLE = 1;
var ARRAW_DOUBLE = 2;
var ARRAW_SRC    = 0;
var ARRAW_TAR    = 1;
//SHOW
var SHOW_NONE = 0;
var SHOW      = 1;
//system 的类型
var SYSTEM     = "super_System";//super
var LINK       = "super_link";//super
var ARRAY      = 'array';
var STYLE_ROOT = 'container';
var POINT      = 'point';
// var TYPE_SYSTEM    = "System";
// var TYPE_WORK      = "Work";
// var TYPE_DATA      = "Data";
// var TYPE_PROTOCOL  = "Protocol";
// var TYPE_PREDICATE = "Predicate";
// var TYPE_TASK      = "Task";
// var TYPE_NAMELABEL = 'NameLabel';
//link 类型

var TYPE_TRANSITION         = "transition";
var TYPE_INTERACTION        = "interaction";
var TYPE_CREATE             = "create";
var TYPE_RELATION           = "relation";
var TYPE_INHERITANCE        = "inheritance";
var TYPE_LINK               = "link";
//arrya

//container : SysForView 的最顶层

//其他DSC元素

var SEQBLOCK   = 'seqblock';
var BEGINPOINT = 'BeginPoint';
var ENDPOINT   = 'EndPoint';
var PRECOND    = 'PreCond';
var POSTCOND   = 'PostCond';
var EXITPOINT  = 'ExitPoint';
var COMMENT    = 'Comment';
var GROUP      = 'Group';
//ICONS
var ICON_SYSTEM      = "icons/compositesystem.gif";
var ICON_WORK        = "icons/work_blue.gif";
var ICON_DATA        = "icons/compositedata.gif";
var ICON_PROTOCOL    = "icons/compositepro.gif";
var ICON_PREDICATE   = "icons/compositepred.gif";
var ICON_TASK        = "icons/task.gif";
//UNDEFINE ICONS
var ICON_SYSTEM_GRAY      = "icons/system.gif";
var ICON_WORK_GRAY        = "icons/work_gray.gif";
var ICON_DATA_GRAY        = "icons/data.gif";
var ICON_PROTOCOL_GRAY    = "icons/protocol.gif";
var ICON_PREDICATE_GRAY   = "icons/predicate.gif";
var ICON_TASK_GRAY        = "icons/task_gray.gif";
//MENU ICONS
var ICON_INSTANTIATE   = "icons/instance.gif";

//UI
var TEXT_INPUT     = "text_input";
var CONTEXT_MENU   = "context_menu";

//input type
//var INPUT_NAME = "input_name";
//var INPUT_TEXT_CONTENT = "input_text_content";
//var INPUT_COMBO_CONTENT = "input_combo_content";
//var INPUT_DIR = 'input_dir';

//protocol dir
var PRODIR = '→';
var PROREDIR = '←';

//Editor Type
var VIEWER    = 0;
var VIEW      = 1;
var VIEWUIO   = 2;

//derive flag
var NOTDERIVE   = "none";
var SENDER      = "sender";
var RECEIVER    = "receiver";

//鼠标的移动状态
var MOVE = 0;
var DRAG = 1;
//鼠标位置状态
var SPACE          = 0;
var DEFAULT        = 0;
// var EDIT_NAME      = 0;
// var EDIT_CONTENT   = 1;
// var EDIT_LINK_CONTENT = 19;
// var EDIT_DIRECTION = 2;
// var EDIT_STATICCNT = 3;
var SEND_MSG       = 4;
var RECEIVE_MSG    = 5;
//resize
var RESIZE_LEFT   = 6;
var RESIZE_RIGHT  = 7;
var RESIZE_TOP    = 8;
var RESIZE_BOTTOM = 9;
var RESIZE_L_T    = 10;
var RESIZE_R_T    = 11;
var RESIZE_L_B    = 12;
var RESIZE_R_B    = 13;
//link area
var LINK_SRC = 14;
var LINK_TAR = 15;
//dray
var MOVE_SYSTEM = 16;
//禁止
var MOUSE_FORBID = 17;
var MOUSE_CREATE = 18;


//presenterName
var PRESENTERNAME = 'presenterName';
// MSGTYPE
var MSG_TYPE  = 'msgType';
//VIEW MSG
var MSG_SAVE  = 'save';
var MSG_SEND  = 'send';
var MSG_DONE  = 'done';
//SRV MSG
var MSG_VIEW     = 'view';
var MSG_VIEW_UIO = 'viewUio';
var MSG_ACTIVATE = 'activate';
var MSG_DEACTIVE = 'deactivate';
var MSG_IN       = 'inMsg';
//简单 复合
var SIMPLE    = 'simple';
var COMPOSITE = 'composite';
//command event type
var CMD_COPY   = '_copy';
var CMD_CUT    = '_cut';
var CMD_PASTE  = '_paste';
var CMD_DELETE = '_delete';
var CMD_RECORD = '_record';
var CMD_CHANGE_TYPE = '_change_type';
var CMD_INSTANTIATE = '_instantiate';
var CMD_NO_INSTANTIATE = '_no_instantiate';
var CMD_ADD_SHADOW = '_add_shadow';
var CMD_REMOVE_SHADOW = '_remove_shadow';
var CMD_DRILL_DOWN = '_drill_down';
var CMD_DRILL_UP   = '_drill_up';
var CMD_EDIT_STATIC = '_edit_static';
var CMD_DEFINE_USER = '_define_user';
var CMD_LAYOUT = '_layout';
var CMD_COMPLEXITY = '_complexity';
var CMD_CHANGE_MARK = '_change_mark';
var CMD_SYNTAX_ERROR = '_syntax_error';
var CMD_SHOW_CONTENT = '_show_content';
var CMD_HIDE_CONTENT = '_hide_content';
var CMD_SHOW_NAME = '_show_name';
var CMD_HIDE_NAME = '_hide_name';
var CMD_SAVE = '_save';
var CMD_SAVE_AS = '_save_as';
var CMD_DERIVE = '_derive';
var CMD_GENERATE_SLIDES = '_generate_slides';
var CMD_GENERATE_DOC = '_generate_doc';
var CMD_GENERATE_CODE = '_generate_code';
var CMD_SEARCH = '_search';
var CMD_EDIT_ARRAY = '_edit_array';
var CMD_EXPORT_SLIDE = '_export_slide';
var CMD_IMPORT = '_import';


//exit condition
var EXIT_OR  = '⋁';
var EXIT_AND = '⋀';
var EXIT_XOR = '⊕';

var INTEGER = 'Integer';
var STRING = 'String';
var CHAR ='Char';
var REAL = 'Real';

var namePrefix = '#DSC_';
